package com.boot.system.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 菜单权限表
 * </p>
 *
 * @author
 * @since 2017-11-08
 */
@Data
@Schema(description = "系统菜单")
public class SysMenuDTO implements Serializable {

    /**
     * 菜单ID
     */
    @Schema(description = "菜单编号")
    private String menuId;

    /**
     * 上级菜单
     */
    @Schema(description = "上级菜单编号")
    private String parentId;

    /**
     * 菜单类型
     */
    @Schema(description = "菜单类型")
    private String menuType;

    /**
     * 路由路径
     */
    @Schema(description = "路由路径")
    private String path;

    /**
     * 路由名称
     */
    @Schema(description = "路由名称")
    private String name;

    /**
     * 组件路径
     */
    @Schema(description = "组件路径")
    private String component;

    /**
     * 路由重定向
     */
    @Schema(description = "路由重定向")
    private String redirect;

    /**
     * 菜单属性
     */
    private SysMenuMetaDTO meta;

    /**
     * 排序
     */
    @Schema(description = "排序")
    private Integer sortOrder;

    /**
     * 子菜单
     */
    @Schema(description = "子菜单")
    private List<SysMenuDTO> children;

    public List<SysMenuDTO> getChildren() {
        if (children == null) {
            children = new ArrayList<>();
        }
        return children;
    }

}
